<?php

/**
 * 满减
 * Class CashRebate
 */
class CashReturn extends Cash
{
    private $condition;
    private $return;

    public function __construct($condition, $return)
    {
        $this->condition = $condition;
        $this->return = $return;
    }

    public function acceptMoney($money)
    {
        if ($money > $this->condition) {
            $money = $money - $this->return;
        }

        return $money;
    }
}